import request from "@/utils/request";

// 查询列表
export function getList(data) {
  return request({
    url: "/business/collect/list",
    method: "get",
    params: data,
  });
}
// 查询列表 详情
export function getDetails(data) {
  return request({
    url: "/business/execute/worklog/detail?id=" + data,
    method: "get",
  });
}
// add 列表
export function addList(data) {
  return request({
    url: "/business/collect/insert",
    method: "post",
    data: data,
    custom: {
      loading: true,
      text: '保存成功'
    },
  });
}
// update 列表
export function updateList(data) {
  return request({
    url: "/business/collect/update",
    method: "post",
    data: data,
  });
}
// delete 列表
export function deleteList(data) {
  return request({
    url: "/business/collect/delete/" + data,
    method: "post",
  });
}
// delete 列表
export function deleteListAll(data) {
  return request({
    url: "/business/collect/deleteBatch?ids=" + data,
    method: "post",
  });
}
// 导入 单位
export function addFile(data) {
  return request({
    url: "/business/collect/importFromExcel",
    method: "post",
    data: data,
  });
}

// 导出 列表
export function exportFile(data) {
  return request({
    url: "/business/collect/exportToExcel",
    method: "get",
    params: data,
    responseType: "blob",
  });
}
// 下载 模板
export function downloadFile() {
  return request({
    url: "/base/file/template/download/年度检修计划_模板.xls",
    method: "get",
    responseType: "blob",
  });
}
